package com.woniuxy.exam.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.woniuxy.exam.entity.Users;
import com.woniuxy.exam.mapper.UsersMapper;
import com.woniuxy.exam.service.IUsersService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Lzj
 * @since 2023-10-31
 */
@Service
public class UsersServiceImpl extends ServiceImpl<UsersMapper, Users> implements IUsersService {
    @Override
    public List<Users> getAllUsers() {
        LambdaQueryWrapper<Users> wrapper = Wrappers.lambdaQuery(Users.class);
        wrapper.select(Users::getUsername,Users::getId);
        List<Users> usersList = baseMapper.selectList(wrapper);
        return usersList;
    }
}
